home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Design
/
WB Collection.iso
/
workbench werkzeuge
/
clipboard
/
clipbook
/
clipbook.doc
next >
Wrap
Text File
|
1996-04-07
|
18KB
|
469 lines
ClipBook V1.2 © 1994 Nick Portalski
=======================================
Overview
========
I spent a couple of summers working on Macs writing documentation. One of
the most useful tools was the Mac Scrapbook, which allows you to store any
number of 'clips' (text and graphics) and then copy any one to the clipboard
so you can paste it into applications. Items were placed in the scrapbook
via the normal cut'n'paste keys. In fact, I liked it so much that I wrote
this - Amiga Clipbook commodity.
So, the Clipbook allows you to store text and graphics clips, scan through
them and copy any of them to the standard Amiga clipboard. They can then
be pasted into applications. To put something into the Clipbook you simply
have to copy it from an application and paste it into the Clipbook.
Because the Clipbook visually displays a clip you won't ever waste time
by loading the wrong picture or needing to print them all out.
This is useful for logos, 'standard' blocks of text, graphics you use
often etc etc. If you use a particular graphics brush often then instead of
having to load it (and remember the path!) each time you can simply store
it in the clipboard and copy it out each time you need it.
It is important to remember that this will only work with applications
which use the standard Amiga Clipboard. (DPaint AGA, Ced, FinalWriter
the SAS/C SE editor etc).
Improvments since V1.0
======================
You can now load a clip into the Clipbook from a file. This is useful
if, say, your graphics program doesn't use the Amiga clipboard.
The current clip number is held even when you close the window. This means
you won't be taken to the first clip every time the window is opened.
Proper FTXT handling (Especially useful for FinalWriter text.....)
Extra info about non-standard clips displayed.
Added in a few more keys 'cos someone asked me to.
Improvements since V1.1
=======================
Added detection of D2RD clips. Hope to actually draw them soon....
Added AutoPaste. If this is turned on then Clipbook will monitor the
clipboard. When something is pasted into the clipboard it will
automatically be inserted into the Clipbook. Useful if you're trying
to get a lot of clips into the Clipbook at once.
You can now give name clips.
The Paste menu item is now ghosted when there's nothing in the
clipboard.
You can now specify different viewers for ilbm/ftxt/other clips
Fixed some enforcer hits! As far as I know there are no hits now!
(All bug reports to e-mail at end.....)
Distribution
============
All code is Copyright 1994 Nick Portalski. It may be copied and distributed
so long as no commercial profit is made out of it. It may not be modified,
sold, or included in any commercial distribution without my written
permission. Public Domain vendors are not allowed to sell this program for
more than the price of a regular disk, which should be no more than the
equivalent of 5 Dollars. (It may be placed on CD-ROM collections costing
more than this). The author takes no responsibility for any loss or damage
resulting from the use of this program.
This distribution should contain the following files:
ClipBook1.2
ClipBook1.2.info
ClipBook.doc
ClipBook.doc.info
ClipBook.guide
ClipBook.guide.info
iff.library
Requirements
============
* Workbench 2.xx+
* The iff.library by Christian Weber (included in archive).
* Although Clipbook will run happily from floppy it has been designed with
hard drive users in mind.
Installation
============
Clipbook is a commodity - so you can either copy it into the WBStartup
directory or simply run it when you need it. As it uses tooltypes stored
in the icon you must copy the .info file too. If you want to display
ILBM pictures in the clipbook you must copy iff.library to your libs:
directory. Clipbook should only be used from the Workbench.
You should also decide where you want clips to be stored. I suggest
you create a new directory. Specify the path to this directory in
the icon's CLIPDIR tooltype. (See Options below).
When you first run the Clipbook you will be asked "Can't find .cliprc.
Create new one?" Answer "Yes" - this creates a control file required
in the CLIPDIR. See Additional Notes for more information.
Usage
=====
Once run the Clipbook window will appear when you press the hotkey specified
in the tooltype. (Or use the Commodity Exchange program to show its
interface). By default it appears on the Workbench screen, but you can
force it to appear on other screens. (See Options below).
The main part of the window shows the current 'clip', with the rest being
made up of gadgets.
The slider gadget at the bottom allows you to move through all the clips
in the clipbook. The text below the clip gives you information about the
clips (i.e. what type it is) and how many clips there are in total.
The 'View Scrap' button will launch the VIEWER program you have specified
in the tooltypes (see Options below) for the current clip type. This is the
best way to see a clip in full, as the window only displays a small portion.
Also, the Clipbook will not try to work out the colours of ILBM clips,
whereas a viewer such as Multiview will. You can specify different viewers
for FTXT (text), ILBM (graphics) and other clips. See Options below.
The 'Name' string allows you to enter up to 64 characters for a clip's
name. This is extremely useful for clips which Clipbook can't
display (e.g. FinalWriter grapics) as you can still identity them!
To close the Clipbook click on the window's close gadget. The Clipbook will
remain resident and can be displayed with the hotkey again. The 'Remove'
button will close the Clipbook window *and* remove it from memory, whereas
'Hide' will simply close the window and leave Clipbook resident.
There are 2 menus:
The first is fairly straightforward:
Project -> Next Clip : Moves to the next clip in the clipbook
Project -> Previous Clip : Move to the previous clip in the clipbook
Project -> AutoPaste : With this option turned on anything copied
to the clipboard will automatically be
inserted into the Clipbook. (EXCEPT items
which are copied from the Clipbook itself)
Project -> Load Clip From File : See below.
Project -> Remove : Removes the Clipbook from memory
Project -> Hide : Closes the Clipbook window, but leaves the
program resident.
Load Clip From File : Although text programs have used the Amiga clipboard
for some time, a certain well-known graphics program
has only just started using it. On earlier versions it
was impossible to get graphics clips into the Clipbook.
However, selecting this menu option will prompt you
for a file. Select any IFF file (e.g. graphics)
and it will load it and paste it into the Clipbook.
This function does make some basic checks on the
file to check it's IFF, but it is possible to fool it.
The second menu is used to paste items into the Clipbook and to copy them
out. This uses the standard Amiga Clipboard, and the menu shortcut keys are
the ones you'd expect for Cut/Copy/Paste.
In general, to place something into the Clipbook, 'Copy' it to the clipboard
in an application, switch to the Clipbook and select 'Paste'. The item will
be added to the Clipbook at the current position. (It *doesn't* overwrite
anything).
To get a clip from the Clipbook to an Application you have two choices.
'Copy' places a copy of the current clip in the Clipboard. You can then
go to an application and choose Paste. Alternatively 'Cut' will remove
the current clip from the Clipbook and place it in the Clipboard.
Clear deletes the current clip without affecting the clipboard.
However, to copy from or paste to an application that application must
support the standard Amiga clipboard. Fortunately more and more are.
Other Keys
==========
As well as the menu short-cut keys there are 5 others:
Cursor Left - Next Clip
Cursor Right- Previous Clip
Cursor Up Last Clip
Cursor Down First clip
Return Copy current clip to clipboard and close Clipbook window
Combined with the hotkey these make getting a clip out of the Clipbook
very quick and easy, as they're all one-key operations.
Options
=======
All options are given via the tooltypes of Clipbook's icon. If not
present default values are used:
CX_POPUP : If 'YES' the Clipbook Window will open when the program
is run. Default = NO
CX_POPKEY : Hotkey to open the Clipbook Window.
Default is Control Left Alt s
CLIPDIR : The name of the directory where clips are to be stored. If
not present the Clipbook will default to CLIPS:, but this is
usually assigned to RAM:, so clips will not be permanent.
If the specified directory doesn't exist you'll be informed
and the program will quit when you try to open the window.
If there is no .cliprc file in the specified directory you
will be asked if you want to create an (empty) one.
Answering 'No' will quit the program as it can't run without
a .cliprc!
ILBM_VIEWER : The name of the graphics viewer to be run when the
'View Scrap' button is pressed and the current clip is ILBM.
This should include the full path and any arguments to the
viewer.
For example, I use:
'sys:utilities/multiview SCREEN'
Default is sys:utilities/multiview SCREEN
TEXT_VIEWER : As ILBM_VIEWER but used to view FTXT clips.
VIEWER : As above but used for any clips which aren't ILBM or FTXT.
PUBLICSCREEN: The name of the Publicscreen the Clipbook is to open on. If
this isn't specified or the specified screen doesn't exist
Workbench is used.
FORCETOFRONT: If this tooltype is present the Clipbook will always open on
the frontmost screen when the hotkey is pressed - regardless
of whether it's a publicscreen or not. Obviously this can be
very useful but does carry dangers. The program which opened
the screen may not be expecting a window to open and you must
never try to quit the screen's program before closing the
Clipbook window. I cannot guarantee correct operation of the
Clipbook when forced to open on the frontmost screen. It does
seem to work with Ced (with system scrolling routines),
Devpac, FinalWriter, FinalCopy, ProPage and to some extent
DPaint.
Default is not to force to front.
AUTOPASTE: This determines the initial state of the AutoPaste menu item.
Clips Supported
===============
You can actually paste any type of 'Clip' from the Amiga Clipboard
into the Clipbook. However, it will currently only display two types.
FTXT: This is standard text.
ILBM: This is graphics. You'll need iff.library for this to work.
SWRT: The type of clip is used by Softwood (e.g. FinalWriter). The
Clipbook can store these but can't currently display them.
So, for example, you can draw some structured graphics in
FinalWriter, select them, select 'Copy' and then launch the Clipbook.
You can now use 'Paste', and the clipbook will tell you it can't
display it. You can copy/cut it later though and paste it back into
FinalWriter.
D2RD: This is the IFF structured drawing. Again, Clipbook doesn't
currently display the clip.
UNKN: The Clipbook doesn't recognise the clip, but can store it.
NIFF: (Not IFF) You shouldn't see this type, as all clips must be IFF to
be stored in the Amiga clipboard. It therefore indicates that
something has gone wrong with a file in the CLIPDIR.
In the UNKN case the Clipbook will display additional information. This
information is the identifier of the first 'chunk' in the clip. This may
help you remember which application it came from.
There is an additional complication. When storing FTXT (text) in a clip
an application such as FinalWriter needs to store additional information
such as typeface, style etc. When you try and paste this into another
application you may not get all the text. The Clipbook parses FTXT
properly and displays all the text, but if it thinks there is additional
information in the clip it will display something in brackets after the
FTXT. For example, if I copy some text from FinalWriter to the Clipbook
it shows:
FTXT (FCCH)
This tells you where it's come from and that other applications may not
understand it.
Additional Notes
================
Each clips stored in the clipbook is stored as a file. All these files
are stored in the CLIPDIR (see Options below). A 'control' file called
.cliprc is also stored in this directory, which keeps count of the total
number of clips. If the program can't find this .cliprc file it will ask
you if you want to create a new one with 0 entries. If the CLIPDIR is
invalid the program will quit.
You can alter the contents of the CLIPDIR and the .cliprc if you really want
to - but I wouldn't suggest it. If for some reason the .cliprc file is
deleted you can easily re-initialise it to the number of clips in the
directory. Simply cd to the CLIPDIR and type:
echo >.cliprc "X"
Where X is the number of clips in the directory.
Also, be aware that although I can force the Clipbook to open on the
frontmost screen I can't force the viewer run with the 'View Scrap' button
to do the same. If you think this isn't working try taking a look at the
Workbench screen to see if the viewer's window has appeared there. (Although
Multiview will autmoatically bring it's screen to the front).
The History of ClipBook
========================
Version 1.0 First Public Release
(14th June 94)
Version 1.1 Made a buffer bigger due to bug in older versions of FGets()
(27th June 94)
Fixed bug when allocating bitmaps. (Probably only affects AGA
machines) This was probably causing the bug I was blaming on
DPaint!
Added 'Load Clip from File'.
The current clip number is now held even when you close the
window. This means it starts where you left off.
Improved FTXT handling. This now uses iffparse.library.
FinalWriter FTXT clips (normal text) now display properly.
However, other applications may not paste the whole clip as
FinalWriter may store the text as many chunks in the file.
I will add a 'Convert to simple FTXT' feature in future
versions.
Extra information about clips is now displayed, which is
helpful especially for clips of type UNKN.
Fixed bug when opening on a publicscreen. I was releasing
the lock too early.... (Though the chances of this one ever
occuring were tiny!).
Made it use NewLookMenus under 3.0->.
Added Cursor Left, Right, Up, Down and Return (Copy and Hide)
Version 1.2 Added detection of D2RD clips. Hope to actually draw them soon....
(Sep-Oct '94)
Added AutoPaste
Added Naming Clips
Paste menu item now ghosted when there's nothing in the clipboard
Added ability to specify different viewers for ilbm/ftxt/other clips
Fixed some enforcer hits!
Known Bugs
==========
The font adaptive routines (as generated by Gadtoolsbox) aren't great -
and if you use strange fonts you may find some of the text overlapping
the gadgets. I will try to sort this out in future versions.
There are risks with opening windows on non-publicscreens. To be safe
ONLY use the Clipbook when it's open on a non-publiscscreen; don't try and
use the application owning the screen whilst the clipbook is open.
Future of Clipbook
==================
There are several things I want to do with Clipbook. The first is to be able
to display Softwood clips (e.g. from FinalWriter). I also hope to add
structured IFF drawings, EPSF displaying and an AREXX port so that utilities
such as Snap can cut directly to the Clipbook. This means many screenshots
could be captured to the Clipbook, which is useful if you're writing a
manual.
I want to have an index of names the user can look clips up in
Make the window re-sizeable.......
Oh yeah, if you've got over about 30 clips pasting a new one in can take
a few seconds whilst the CLIPDIR is shuffled about. At some point I'll
try to improve on this.
Thanks To
=========
* The authors of GadToolsBox.
* Christian Weber for iff.library
* Mark McPherson for the startup code.
* Matt Jennings for the use of his A3000 (so I could run Enforcer).
* Marcel Offermans for suggesting the functionality of the return key.
Not Only But Also......
========================
This version of Clipbook is free - although if you do use it I'd appreciate
somthing to help encourage future updates!
I would especially like to hear about any applications whose clips it doesn't
recognise. Sending me an example clip would be very helpful - even the first
page of the output from "type xxxx hex" would be good.
I welcome all bug reports, comments and suggestions and can be contacted
by any of the following means:
e-mail: nick@ripple.demon.ac.uk
snail-mail: Nick Portalski
24, Scotland Farm Road
Ash Vale
Aldershot
Hants
GU12 5JB
I hope you find it useful!
--
Nick Portalski
November 1994